<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sentinel LDK Licensing System</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        
        .container {
            background: white;
            border-radius: 20px;
            box-shadow: 0 30px 60px rgba(0,0,0,0.2);
            padding: 60px;
            text-align: center;
            max-width: 600px;
            width: 100%;
        }
        
        .logo {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            border-radius: 50%;
            margin: 0 auto 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2em;
            color: white;
            font-weight: bold;
        }
        
        h1 {
            color: #333;
            font-size: 2.5em;
            margin-bottom: 15px;
            font-weight: 300;
        }
        
        .subtitle {
            color: #666;
            font-size: 1.2em;
            margin-bottom: 40px;
            line-height: 1.6;
        }
        
        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 30px;
            margin-bottom: 40px;
        }
        
        .feature-card {
            background: #f8f9fa;
            padding: 30px 20px;
            border-radius: 15px;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        
        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        }
        
        .feature-icon {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            border-radius: 50%;
            margin: 0 auto 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5em;
            color: white;
        }
        
        .feature-card h3 {
            color: #333;
            margin-bottom: 10px;
            font-size: 1.2em;
        }
        
        .feature-card p {
            color: #666;
            line-height: 1.5;
        }
        
        .nav-buttons {
            display: flex;
            gap: 20px;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        .btn {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            color: white;
            padding: 15px 30px;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            text-decoration: none;
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            display: inline-block;
        }
        
        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
        }
        
        .btn-secondary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .btn-secondary:hover {
            box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
        }
        
        .status {
            margin-top: 30px;
            padding: 15px;
            background: #d4edda;
            color: #155724;
            border-radius: 8px;
            border: 1px solid #c3e6cb;
        }
        
        @media (max-width: 768px) {
            .container {
                padding: 40px 30px;
            }
            
            h1 {
                font-size: 2em;
            }
            
            .features {
                grid-template-columns: 1fr;
            }
            
            .nav-buttons {
                flex-direction: column;
                align-items: center;
            }
            
            .btn {
                width: 100%;
                max-width: 300px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="logo">S</div>
        <h1>Item Ldk Demo</h1>
        
        <div class="nav-buttons">
            <a href="/license" class="btn">🔐 许可管理</a>
            <a href="/users" class="btn">👥 用户管理</a>
            <a href="#" class="btn btn-secondary" onclick="checkHealth()">🔍 健康检查</a>
        </div>
        
        <div id="status" class="status" style="display: none;"></div>
    </div>
    
    <script>
        async function checkHealth() {
            const statusEl = document.getElementById('status');
            
            try {
                const response = await fetch('/api/license/health');
                const result = await response.text();
                
                statusEl.textContent = `✅ ${result}`;
                statusEl.style.display = 'block';
                statusEl.style.background = '#d4edda';
                statusEl.style.color = '#155724';
                statusEl.style.borderColor = '#c3e6cb';
            } catch (error) {
                statusEl.textContent = `❌ 系统连接失败: ${error.message}`;
                statusEl.style.display = 'block';
                statusEl.style.background = '#f8d7da';
                statusEl.style.color = '#721c24';
                statusEl.style.borderColor = '#f5c6cb';
            }
            
            setTimeout(() => {
                statusEl.style.display = 'none';
            }, 3000);
        }
    </script>
</body>
</html>